package com.ruoyi.project.controller;

import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.project.vo.A08EditListRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.project.domain.A08PaymentReceipt;
import com.ruoyi.project.service.IA08PaymentReceiptService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;

/**
 * 收付款信息数据Controller
 * 
 * @author WorrilessGo
 * @date 2025-11-22
 */
@RestController
@RequestMapping("/receipt")
public class A08PaymentReceiptController extends BaseController
{
    @Autowired
    private IA08PaymentReceiptService a08PaymentReceiptService;

    /**
     * 查询收付款信息数据列表
     */
    @RequiresPermissions("wechat:receipt:list")
    @GetMapping("/list")
    public TableDataInfo list(A08PaymentReceipt a08PaymentReceipt)
    {
        startPage();
        List<A08PaymentReceipt> list = a08PaymentReceiptService.selectA08PaymentReceiptList(a08PaymentReceipt);
        return getDataTable(list);
    }

    /**
     * 导出收付款信息数据列表
     */
    @RequiresPermissions("wechat:receipt:export")
    @Log(title = "收付款信息数据", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, A08PaymentReceipt a08PaymentReceipt)
    {
        List<A08PaymentReceipt> list = a08PaymentReceiptService.selectA08PaymentReceiptList(a08PaymentReceipt);
        ExcelUtil<A08PaymentReceipt> util = new ExcelUtil<A08PaymentReceipt>(A08PaymentReceipt.class);
        util.exportExcel(response, list, "收付款信息数据数据");
    }

    /**
     * 获取收付款信息数据详细信息
     */
    @RequiresPermissions("wechat:receipt:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(a08PaymentReceiptService.selectA08PaymentReceiptById(id));
    }




    /**
     * 新增收付款信息数据
     */
    @RequiresPermissions("wechat:receipt:add")
    @Log(title = "收付款信息数据", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody A08PaymentReceipt a08PaymentReceipt)
    {
        return toAjax(a08PaymentReceiptService.insertA08PaymentReceipt(a08PaymentReceipt));
    }

    /**
     * 修改收付款信息数据
     */
    @RequiresPermissions("wechat:receipt:edit")
    @Log(title = "收付款信息数据", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody A08PaymentReceipt a08PaymentReceipt)
    {
        return toAjax(a08PaymentReceiptService.updateA08PaymentReceipt(a08PaymentReceipt));
    }


    /**
     * 修改收付款信息数据
     */
    @RequiresPermissions("wechat:receipt:edit")
    @Log(title = "收付款信息数据", businessType = BusinessType.UPDATE)
    @PutMapping("editList")
    public AjaxResult editList(@RequestBody A08EditListRequest a08EditListRequest)
    {
        return toAjax(a08PaymentReceiptService.editList(a08EditListRequest));
    }

    /**
     * 删除收付款信息数据
     */
    @RequiresPermissions("wechat:receipt:remove")
    @Log(title = "收付款信息数据", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(a08PaymentReceiptService.deleteA08PaymentReceiptByIds(ids));
    }
}
